All Functions of Week 8

ifelse

{base}

Return a or b depending on the value of test

save

{base}

Writes an external representation of R objects to the specified file.

summarize

NA

write.csv

{utils}

write a csv file to a data frame

mutate

{dplyr}

Modify/create a column in a data frame

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

select

{dplyr}

Select columns from a tibble/data frame

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

write_dta

NA

as.character

{base}

Coerce a vector to character

spread

{tidyr}

Spread a key-value pair across multiple columns

slice

{dplyr}

Subset rows using their positions

as.numeric

{base}

Coerce a vector to numeric

sum

{base}

Get sum of numeric values or a vector

recode

{dplyr}

Recode a variable

n

{dplyr}

The number of observations in the current group.

c

{base}

Combine values/vectors into a vector

data.frame

{base}

Create a data.frame from vectors

read_dta

{haven}

Read a .dta file (Stata data)

desc

{dplyr}

Arrange in descending order

mean

{base}

Get mean of a vector

filter

{dplyr}

Filter out rows of a data frame according to logical vector

is.na

{base}

Check if a value is NA/elements of vector are NA

factor

{base}

Create a factor

ordered

{dplyr}

Create an ordered factor

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

setwd

{base}

Set Working Directory

separate

{dplyr}

Separate a character column into multiple columns

library

{base}

Load an R package

cut

{base}

Convert Numeric to Factor

The end!